package czh.cocoa.ui;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import czh.cocoa.foundation.NSObject;
import czh.cocoa.graphics.CGRect;

public class UIScreen extends NSObject {

	private static UIScreen sMainScreen;
	
	public static UIScreen mainScreen() {
		if (sMainScreen == null) {
			sMainScreen = new UIScreen();
		}
		return sMainScreen;
	}
	
	private UIScreen() {
		
	}
	
	public CGRect bounds() {
		Context ctx = UIApplication.sharedApplication().getContext();
		DisplayMetrics display = ctx.getResources().getDisplayMetrics();
		return new CGRect(0, 0, display.widthPixels, display.heightPixels);
	}
	
	public CGRect applicationFrame() {
		CGRect bounds = bounds();
		CGRect statusBarFrame = UIApplication.sharedApplication().statusBarFrame();
		return new CGRect(0, 0, bounds.size.width, 
				bounds.size.height - statusBarFrame.size.height);
	}
	
}
